package com.common.service;

import java.util.List;

import javax.annotation.Resource;

import com.common.dao.RoleMapper;
import com.common.entity.PageRole;
import com.common.entity.Role;
import com.common.entity.RoleCorrelationPermission;

/**
 * <p>User: Zhang Kaitao
 * <p>Date: 14-1-28
 * <p>Version: 1.0
 */
public class RoleServiceImpl implements RoleService {
    @Resource
    private RoleMapper roleMapper;

    public int createRole(Role role) {
        return roleMapper.insertRole(role);
    }

    public void deleteRole(Role role) {
        roleMapper.deleteRole(role);
    }

	@Override
	public int correlationPermission(RoleCorrelationPermission rolePermission) {
		return roleMapper.correlationPermission(rolePermission);
	}

	@Override
	public int uncorrelationPermission(RoleCorrelationPermission rolePermission) {
		return roleMapper.uncorrelationPermission(rolePermission);
	}

	@Override
	public List<PageRole> getAllRoleList() {
		return roleMapper.getAllRoleList();
	}

	@Override
	public Role getRoleByName(Role role) {
		return roleMapper.getRoleByName(role);
	}

	@Override
	public List<Role> getRolesList() {
		return roleMapper.getRolesList();
	}

}
